package com.dhcc.service.impl;


import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.dhcc.entity.SysUserOrganization;
import com.dhcc.mapper.SysUserOrganizationMapper;
import com.dhcc.service.SysUserOrganizationService;
import jakarta.annotation.Resource;
import org.springframework.stereotype.Service;

import java.util.List;


@Service
public class SysUserOrganizationServiceImpl extends ServiceImpl<SysUserOrganizationMapper, SysUserOrganization> implements SysUserOrganizationService {

    @Resource
    private  SysUserOrganizationMapper sysUserOrganizationMapper;
    @Override
    public List<String> selectInstitutionIdList(String userId) {
        List<String> sysInstitutionIds= sysUserOrganizationMapper.selectInstitutionIdsByUserId(userId);
        return sysInstitutionIds;
    }

    @Override
    public List<String> getUserIdsByInstitutionId(String institutionId) {
        return sysUserOrganizationMapper.getUserIdsByInstitutionId(institutionId);
    }

    @Override
    public Integer add(String userId, String institutionId) {

        return sysUserOrganizationMapper.add(userId,institutionId);
    }

    @Override
    public Integer deleteByUserIdAndInstitutionId(String userId, String institutionId) {
        return sysUserOrganizationMapper.deleteByUserIdAndInstitutionId(userId,institutionId);
    }
}
